package de.upb.messerschmidt.set.entity;

import java.util.ArrayList;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

/**
 * A Contact is a following-relation between to {@link Person} entities (stored
 * as Key).
 * 
 * @author Tim Messerschmidt
 * 
 */

@PersistenceCapable
public class Contact {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	@Persistent
	private Key user;
	@Persistent
	private Key contact;
	@Persistent
	private ArrayList<String> metAtEvent = new ArrayList<String>();

	/**
	 * @param user
	 * @param contact
	 */
	public Contact(Key user, Key contact) {
		this.user = user;
		this.contact = contact;
	}

	/**
	 * @return the key
	 */
	public Key getKey() {
		return key;
	}

	/**
	 * @return the user
	 */
	public Key getUser() {
		return user;
	}

	/**
	 * @return the contact
	 */
	public Key getContact() {
		return contact;
	}

	/**
	 * @return the metAtEvent
	 */
	public ArrayList<String> getMetAt() {
		return metAtEvent;
	}

	/**
	 * @param key
	 *            the key to set
	 */
	public void setKey(Key key) {
		this.key = key;
	}

	/**
	 * @param user
	 *            the user to set
	 */
	public void setUser(Key user) {
		this.user = user;
	}

	/**
	 * @param contact
	 *            the contact to set
	 */
	public void setContact(Key contact) {
		this.contact = contact;
	}

	/**
	 * @param metAt
	 *            the metAt to set
	 */
	public void setMetAt(ArrayList<String> metAt) {
		this.metAtEvent = metAt;
	}
}
